 <%@ page contentType="text/html; charset=UTF-8" pageEncoding="utf-8"%>
<%@ include file="/common/init.jsp"%>
<div id="activitylist">
	<div class="vvbt" style="margin-top: 20px;">
		<table width="840" border="0" align="center" cellpadding="0" cellspacing="0">
			<tr>
				<td width="150" class="vvd">申请金额</td>
				<td width="150" class="vvd">汇款金额</td>
				<td width="150" class="vvd">发放激活豆</td>
				<td width="150" class="vvd">申请时间</td>
				<td width="80" class="vvd">状态</td>
				<td width="80" class="vvd">查看</td>
				<td width="80" class="vvd">操作</td>
			</tr>
		</table>
	</div>
	<table width="840" border="0" align="center" cellpadding="0" cellspacing="0">
		<c:forEach var="apply" items="${page.result }">
			<tr>
				<td width="150" class="vv">${apply.applyAmount} <input
					type="hidden" id="" value="${apply.id }" name="" />
				</td>
				<td width="150" class="vv">${apply.cash }</td>
				<td width="150" class="vv">${apply.actAmount }</td>
				<td width="150" class="vv"><fmt:formatDate
						value="${apply.applyDate}" pattern="yyyy-M-dd HH:mm:ss" /></td>
				<td width="80" class="vv"><c:if test="${apply.status eq '0'}">已申请</c:if>
					<c:if test="${apply.status eq '1'}">待审核</c:if> <c:if
						test="${apply.status eq '2'}">申请成功</c:if></td>
				<td width="80" class="vv"><a href="getbankinfo.action?applyId=${apply.id }" target="_blank">查看详情</a></td>
				<td width="80" class="vv">
					<c:choose>
						<c:when test="${apply.status eq '0'}">
							<a href="javascript:void(0);" style="text-decoration: none;">
								<span onclick="toRemit('${apply.id}');">填写汇款单</span>
							</a>
						</c:when>
						<c:otherwise>---</c:otherwise>
					</c:choose>
				</td>
			</tr>
		</c:forEach>
	</table>
	<%@ include file="/common/turnpage.jsp"%>
</div>
<script type="text/javascript">
	function frontpage(pageNo) {
		$.ajax({
			type : 'POST',
			url : "${ctx}/activitylist.action?pageNo=" + pageNo,
			dataType : "html",
			success : function(data, status) {
				if ($.trim(data) != '') {
					$("#activitylist").html(data);
				}
			},
			error : function(data, status, e) {
				alert(e.name);
			}
		});
		//window.frames["exchangelist"].location.href = "${ctx}/exchangelist.action?pageNo="+pageNo;
	}

	function nextpage(pageNo) {
		$.ajax({
			type : 'POST',
			url : "${ctx}/activitylist.action?pageNo=" + pageNo,
			dataType : "html",
			success : function(data, status) {
				if ($.trim(data) != '') {
					$("#activitylist").html(data);
				}
			},
			error : function(data, status, e) {
				alert(e.name);
			}
		});
		//location = "${ctx}/exchangelist.action?pageNo="+pageNo;
		//window.frames["exchangelist"].location.href = "${ctx}/exchangelist.action?pageNo="+pageNo;
	}
	
	function toRemit(id){
		window.location.href = "${ctx}/toremit.action?applyId="+id;
	}
	
	function lookbank(id){
		var iTop = (window.screen.availHeight-30-iHeight)/2;       //获得窗口的垂直位置;
		var iLeft = (window.screen.availWidth-10-iWidth)/2;           //获得窗口的水平位置;
		window.open('getbankinfo.action?applyId='+id,'公司银行信息','height=400,width=600,top='+iTop+',left='+iLeft+',toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no'); 
		
	}
</script>